package awd.bj.jls.webs.api;

import awd.bj.jls.webs.api.hystrix.ManagerApiFallBackFactory;
import awd.bj.jls.webs.api.model.User;
import awd.bj.jls.webs.api.model.WgTree;
import awd.bj.jls.webs.utils.PagerResult;
import awd.bj.jls.webs.utils.QueryParam;
import awd.bj.jls.webs.utils.ResponseMessage;
import awd.bj.manager.model.ClassficModel;
import awd.bj.manager.model.MenusModel;
import awd.bj.manager.model.WgzdModel;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @program: awd.bj.kss
 * @description:
 * @author: WS
 * @create: 2019-01-22
 **/
@FeignClient(name = "${awd.mis.manager.server:AWD-MIS-MANAGER-SERVER}", fallbackFactory = ManagerApiFallBackFactory.class)
@Component
public interface ManagerApi {
    @RequestMapping(path = {"/classfic/save}"})
    ResponseMessage<String> classficAdd(@RequestBody ClassficModel var1);

    @PostMapping(path = {"/classfic/list"})
    ResponseMessage<List<ClassficModel>> classficList(@RequestBody Map<String, String[]> var1);

    @PutMapping(path = {"/classfic/{id}"})
    ResponseMessage<Integer> classficUpdateByPrimaryKey(@PathVariable("id") String var1, @RequestBody ClassficModel var2);

    @GetMapping(path = {"/classfic/findNode/{parentid}"})
    ResponseMessage<List<ClassficModel>> classficFindNode(@PathVariable("parentid") String var1);

    @GetMapping(path = {"/classfic/findNodes/{parentid}"})
    ResponseMessage<List<ClassficModel>> classficFindNodes(@PathVariable("parentid") String var1);

    @PostMapping(path = {"/classfic/query"})
    ResponseMessage<PagerResult<ClassficModel>> classficQuery(@RequestBody Map<String, String[]> var1);

    @GetMapping(path = {"/classfic"})
    ResponseMessage<PagerResult<ClassficModel>> classficGetAllClassfic();

    @GetMapping(path = {"/classfic/findNode"})
    ResponseMessage<List<ClassficModel>> classficFindWgNode(@RequestParam("lx") String var1, @RequestParam(value = "parentid", defaultValue = "0") String var2);

    /**
     * 违规字典
     */

    @PostMapping("wgzd/extMultiCheckboxTree")
    List<WgTree> getWgTreeList(@RequestParam(value="id",required=false) String id);

    @PostMapping("/wgzd/list")
    public ResponseMessage<List<WgzdModel>> wgzdList(@RequestBody Map<String,String[]> map);

    //违规字典查询（带分页）
    @PostMapping("wgzd/query")
    public ResponseMessage<PagerResult<WgzdModel>> wgzdQueryForPage(@RequestBody Map<String,String[]> map);


    //根据id 获取违规字典信息
    @RequestMapping("/wgzd/{id}")
    ResponseMessage<WgzdModel> wgzdGetByid(@PathVariable("id")String id);

    //新增违规字典
    @PostMapping("/wgzd")
    public ResponseMessage<String> wgzdSave(@RequestBody WgzdModel wgzdModel);

    //根据id 如果没有新建有就更新违规字典
    @PatchMapping("/wgzd")
    public ResponseMessage<String> wgzdSaveorupdate(@RequestBody WgzdModel wgzdModel);

    //根据id 更新违规字典
    @PutMapping("/wgzd/{id}")
    public ResponseMessage<String> wgzdUpdate(@RequestParam(value="id") String id ,@RequestBody WgzdModel wgzdModel);


    @RequestMapping(value="/authorization/getUserByName",method=RequestMethod.GET)
    public ResponseMessage<User> getUserByName(@RequestParam("jsbh")String jsbh, @RequestParam("username")String username);
    
    @RequestMapping(value="/menus/add",method=RequestMethod.POST)
    public ResponseMessage<String> menusSave(@RequestParam("appcode")String appcode, @RequestParam("menu")String menu, @RequestParam("fname")String fname, @RequestParam("name")String name, @RequestParam("url")String url,
    		@RequestParam("creator")String creator, @RequestParam("createtime")Date createtime);

    @RequestMapping(value="/menus",method=RequestMethod.GET)
	ResponseMessage<PagerResult<MenusModel>> menusQuery(QueryParam param);

    @RequestMapping(value="/setting/add",method=RequestMethod.POST)
    public ResponseMessage<String> settingInit(@RequestParam("appcode")String aPPCODE, @RequestParam("progroup")String progroup, @RequestParam("type")String type, @RequestParam("proname")String key,@RequestParam("pronamezh")String pronamezh,
    		@RequestParam("provalue")String value, @RequestParam("user")String creator);

	


}
